﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DIProject.ReceptionGoods
{
    public class WaybillInfo
    {
        private string  _tableName;

        public string  TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }

        private string _numWaybill;
        /// <summary>
        /// Номер накладной
        /// </summary>
        public string NumWayBill
        {
            get { return _numWaybill; }
            set { _numWaybill = value; }
        }
        private DateTime _dateWaybill;
        /// <summary>
        /// Дата накладной
        /// </summary>
        public DateTime DateWaybill
        {
            get { return _dateWaybill; }
            set { _dateWaybill = value; }
        }
        public WaybillInfo()
        {
            _dateWaybill = DateTime.MinValue;
            _numWaybill = string.Empty;
        }
        public override string ToString()
        {
            return "Накладная № " + this.NumWayBill + " от " + this.DateWaybill.ToString("d");
        }
        public override bool Equals(object obj)
        {
            if (object.Equals(this, obj))
                return true;
            if (obj is WaybillInfo)
            {
                WaybillInfo w = obj as WaybillInfo;
                if ((this.DateWaybill == w.DateWaybill) && (this.NumWayBill == w.NumWayBill))
                    return true;
            }
            return false;
        }
		public override int GetHashCode()
		{	return base.GetHashCode();
		}

    }
    
    
}
